Skip to content

[Python] Move JupyROOT to be private submodule of ROOT#21150

Merged
guitargeek merged 7 commits intoroot-project:masterfrom
guitargeek:lazy_root
Feb 5, 2026
Merged

[Python] Move JupyROOT to be private submodule of ROOT#21150
guitargeek merged 7 commits intoroot-project:masterfrom
guitargeek:lazy_root

Conversation

@guitargeek
Copy link
Contributor

JupyROOT should not be accessed by the user, and not having it as a separate package makes packaging cleaner. In the end, ROOT should only ship the ROOT package.

The PR also contains some commits to defer the import of cppyy and the initialization of the C++ runtime to the last possible moment, so we're not (partially) initializing it when importing the ROOT module. This is what makes it possible to have clean Python-only ROOT submodules like _jupyroot without the unwanted sideeffects of initializing the C++ runtime on import.

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

Test Results

    22 files      22 suites   3d 11h 2m 1s ⏱️
 3 776 tests  3 776 ✅ 0 💤 0 ❌
75 119 runs  75 119 ✅ 0 💤 0 ❌

Results for commit d4fae9e.

♻️ This comment has been updated with latest results.

@guitargeek guitargeek force-pushed the lazy_root branch 3 times, most recently from 5c63f75 to 418784b Compare February 4, 2026 14:10
Copy link
Member

@vepadulano vepadulano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this is the right direction, LGTM! Just a small comment for consideration.

This file is not referred to anywhere in the codebase, and it also is
not valid Python becayse `get_config` is defined nowhere.
This was probably left over from JupyROOT development. ROOT ships its
own `kernel.json` file in `etc/notebook/kernels/root/kernel.json`.
This is not needed, as namespaces like `ROOT` are dynamically looked up
by cppyy. Setting attributes of the ROOT module will only cause trouble
in JupyROOT, because the `libROOTPythonization` extension is also
imported there.
This cppyy import is deferred to `ROOTFacade._finalSetup().
Delaying this step avoids importing the heavy-weight cppyy machinery
unless it is actually required (for example, when accessing C++ ROOT
symbols), allowing Python-only ROOT submodules to be imported with
minimal overhead.
JupyROOT should not be accessed by the user, and not having it as a
separate package makes packaging cleaner. In the end, ROOT should only
ship the ROOT package.
@guitargeek guitargeek merged commit 1b4ea0c into root-project:master Feb 5, 2026
30 checks passed
@guitargeek guitargeek deleted the lazy_root branch February 5, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants